<?php

/**
 * ProductOrderVsProduct form base class.
 *
 * @method ProductOrderVsProduct getObject() Returns the current form's model object
 *
 * @package    jobeet
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: BaseProductOrderVsProductForm.class.php 7 2011-04-20 11:17:06Z Inoryy@gmail.com $
 */
abstract class BaseProductOrderVsProductForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'product_id' => new sfWidgetFormInputHidden(),
      'order_id'   => new sfWidgetFormInputHidden(),
    ));

    $this->setValidators(array(
      'product_id' => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'product_id', 'required' => false)),
      'order_id'   => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'order_id', 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('product_order_vs_product[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'ProductOrderVsProduct';
  }

}
